enum EDialogResult;
enum EServerPacketType;
struct packet_base;
class CNetrekClientListener;


namespace AVUI
{
    class Object;
    class RoutedEventArgs;
    class FrameworkElement;
}

class CGameStateLogin : public CBaseGameState, public IPacketSink
{
public:
    CGameStateLogin() { }

    bool ProcessPacket(EServerPacketType, const packet_base* pPacket);
    void FrameStart();
    void Initialize(CNetrekClientListener* pListener);
    void Cleanup();

private:

    void ErrorDialogOK(EDialogResult) { };
    void InitDialogCancel(EDialogResult);

    enum ELoginState
    {
        eLoginState_PendingInit,
        eLoginState_Idle,
        eLoginState_Verifying,
        eLoginState_LoggingIn
    };

    void LoginButtonClicked(AVUI::Object* pObject, AVUI::RoutedEventArgs* pEventArgs);
    void CancelButtonClicked(AVUI::Object* pObject, AVUI::RoutedEventArgs* pEventArgs);
    void CreateNewButtonClicked(AVUI::Object* pObject, AVUI::RoutedEventArgs* pEventArgs);

    ELoginState m_eLoginState;
    char m_szLoginName[16];
    char m_szLoginPass[16];

    AVUI::FrameworkElement* m_pRoot;
    bool m_initReceived;
    DWORD m_dwTimeBegan;
};


